<div class="tool-container">
    <div class="layui-card">
        <div class="layui-card-header">上传工具</div>
        <div class="layui-card-body">
                <div class="layui-form-item">
                    <div class="">
                        <button type="button" class="layui-btn layui-btn-normal" id="select">选择文件</button>
                        <button type="button" class="layui-btn" id="upload">开始上传</button>
                    </div>
                </div>


                <div class="layui-form-item">
                    <div class="">
                        <textarea name="description" placeholder="请输入文件描述（可选）" class="layui-textarea"
                            rows="2" id="description"></textarea>
                    </div>
                </div>

                <div class="layui-word-aux">支持格式: .zip .rar .exe .msi .gz .tar .7z (最大16MB)</div>
        </div>
    </div>

    <hr class="layui-border-green">

    <div class="layui-card">
        <div class="layui-card-header">工具列表</div>
        <div class="layui-card-body">
            <table class="layui-table">
                <colgroup>
                    <col width="25%">
                    <col width="35%">
                    <col width="10%">
                    <col width="20%">
                    <col width="10%">
                </colgroup>
                <thead>
                    <tr>
                        <th>文件名</th>
                        <th>描述</th>
                        <th>大小</th>
                        <th>上传时间</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    {% for tool in files %}
                    <tr>
                        <td>{{ tool.name }}</td>
                        <td>{{ tool.description }}</td>
                        <td>{{ tool.size }}</td>
                        <td>{{ tool.date }}</td>
                        <td>
                            <a href="{{ url_for('file.download', filename=tool.name) }}"
                                class="layui-btn layui-btn-xs layui-btn-normal">下载</a>
                            <button class="layui-btn layui-btn-xs layui-btn-danger delete-btn"
                                data-id="{{ tool.id }}">删除</button>
                        </td>
                    </tr>
                    {% else %}
                    <tr>
                        <td colspan="5" style="text-align: center;">暂无工具</td>
                    </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
    </div>
</div>